package tech.lingrui.mnpanonymousservice.model.bean;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Objects;

/**
 * 用户model
 *
 * @author lqs2
 * @date 2018/11/25, Sun
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
public class UserModel extends BaseModel {

    /**
     * 用户空闲状态
     */
    public static final int USER_STATE_FREE = 101;

    /**
     * 用户正处于等待被匹配状态
     */
    public static final int USER_STATE_WAITING = 201;

    /**
     * 用户正在游戏状态
     */
    public static final int USER_STATE_GAME = 301;

    /**
     * 微信名字
     */
    private String name;

    /**
     * 微信头像url
     * */
    private String headSculpture;

    /**
     * 当前用户的状态
     */
    private int state;

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof UserModel)) {
            return false;
        }
        UserModel m = (UserModel) obj;
        return name.equals(m.name);
    }
}
